﻿@using LY.Business.ServiceImpl
@using LY.Entity
@using LY.Entity.Entities
@using LY.Entity.PageSearch
@using LY.Interface

@model PagedList<ProjectEx>
@{
    ViewBag.Title = "众筹列表";
    Layout = "~/Views/Shared/_Layout.cshtml";
    IProjectService _projectService = new ProjectService();
    var project_exList = Model;
}
<link href="~/Content/list1.css" rel="stylesheet" />
<link href="~/Content/common.css" rel="stylesheet" />
<link href="~/Scripts/laypage/skin/laypage.css" rel="stylesheet" />

<style>
    .bannerimg2 {
        width: 100%;
        height: 366px;
    }

    .hot {
        width: 200px;
        height: 200px;
        background-color: #fa5656;
        border-radius: 100px;
        margin: 0px auto;
    }

    .hot_title {
        width: 120px;
        height: 120px;
        background-color: #fa5656;
        border: 5px solid #fff;
        margin: 0px auto;
        margin-top: 35px;
        margin-left: 35px;
        position: absolute;
        color: #484848;
        font-size: 25px;
        border-radius: 65px;
        text-align: center;
    }

        .hot_title .title {
            color: #fff;
            padding-top: 20px;
        }

    .hot_con {
        font-size: 16px;
    }

    .type {
        font-size: 25px;
        text-align: center;
    }

    .monetary_fund_right_content2 {
        display: none;
    }

    .tabBox {
        height: 36px;
        width: 100px;
        left: 50%;
        margin-top: 10px;
        position: relative;
        margin-left: -36px;
    }

        .tabBox ul {
            padding: 0;
            margin: 0;
            list-style-type: none;
        }

        .tabBox a {
            float: left;
            cursor: pointer;
            width: 15px;
            height: 15px;
            border-radius: 10px;
            margin: 0 6px;
            display: inline-block;
            font-size: 0px;
            text-indent: -9999px;
            line-height: 0;
            cursor: pointer;
            background: #eee;
        }

            .tabBox a.activeSlide {
                background: #ff5d5e;
            }
</style>
<div class="change_banner"></div>
<div class="line10"></div>
<div class="container">
    <div class="wrap mt20">
        <div class="l-header">
            <i class="l-icons lb-icons"></i>
            项 目 列 表  
        </div>
        <div class="l-info">
            <div class="l-menubox">
                <ul class="l-menu">
                    <li class="cur" code="">
                        <i class="b-icons qb-icons" style="background-position: 0 -22px;"></i>
                        <a class="m-text" code="" name="category" href="/DeFault/List1">全部</a>
                    </li>
                    @{
                        List<R_ProjectClass> projectClass = ViewBag.ProjectClass;
                        for (int i = 0; i < projectClass.Count; i++)
                        {
                        <li parentid="@projectClass[i].ParentId" code="@projectClass[i].Id">
                            <i class="b-icons  @projectClass[i].Id  showchange" ></i>
                            <a name="category" code="10" href="/DeFault/List1?ProjectClassId=@projectClass[i].Id" class="m-text">@projectClass[i].Name</a>
                        </li>  
                        }
                    }
                </ul>
            </div>
            <div style="width: 940px; float: left; padding-top: 20px;">

                <div class="monetary_fund_content">
                    <div style="float: left; width: 400px;">
                        @*             <div class="prev_con">
                                <span id="prev" class="prev">
                                    <img src="~/Content/change/images/claim_left_red.png" /></span>

                            </div>*@
                        <div class="right300">
                        </div>
                    </div>
                    <div style="float: right; width: 400px;">
                    </div>

                </div>


            </div>

            <div style="width: 940px; height: 400px; float: right;">
                <div class="prev_con" style="float: left; width: 50px; height: 400px; line-height: 400px;">
                    <span id="prev" class="prev">
                        <img src="~/Content/change/images/claim_left_red.png" /></span>

                </div>

                <div style="float: left; width: 400px;">
                    <div class="monetary_fund_right2">

                        @foreach (var item in ViewBag.Project_Hot)
                        {
                            <div class="monetary_fund_right_content2">
                                <div class="hot">
                                    <div class="hot_title">
                                        <div class="title">
                                            热门<br />
                                            榜单
                                        </div>
                                    </div>
                                </div>
                                <p class="type"><a style="color:#666" href="/Default/Detail/@item.Id" target="_blank">@item.ProjectName</a></p>
                                <p class="hot_con">
                                    @item.ProjectAdWord
                                </p>
                            </div>
                        }
                    </div>
                    <div class="focus">
                    </div>
                </div>
                <div style="float: left; width: 440px;">
                    <div class="top-banner" id="banner2">
                        @foreach (var item in ViewBag.Project_Hot)
                        {
                            <a class="bannerimg2" href="/Default/Detail/@item.Id" style="background: url(@item.ProjectThumImage) no-repeat center 0;" target="_blank"></a>
                        }


                    </div>
                </div>
                <div class="next_con" style="float: right; width: 50px; height: 400px; line-height: 400px;">
                    <span id="next" class="next">
                        <img src="~/Content/change/images/claim_right_red.png" /></span>

                </div>
                <div class="clear"></div>
                <div class="tabBox">
                    <ul id="btn2" class="btn">
                    </ul>
                </div>

            </div>
        </div>
        <div class="l-result1">
            <div style="background-color: #f8f7f7;">
                <div class=" select2 mb20 pr">
                    <div class="s-tits" id="status_p">
                        <span class="s-checked" code=""><i class="s-icons"></i>全部</span>
                        <span class="s-unchecked" code="210"><i class="s-icons"></i>众筹中</span>
                        <span class="s-unchecked" code="220"><i class="s-icons"></i>众筹成功</span>
                    </div>
                    <div class="s-lists">
                        <div class="s-list" id="sort_p">
                            <a href="javascript:;" code="zhtj" id="zhtj" class="cur">综合推荐</a>
                            <a href="javascript:;" code="zxsx" id="zxsx">最新上线</a>
                            <a href="javascript:;" code="jezg" id="jezg">金额最多</a>
                            <a href="javascript:;" code="zczd" id="zczd">支持最多</a>
                            <a href="javascript:;" code="jjjs" id="jjjs">即将结束</a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="lr-lists">
                <ul class="infos">
                    <!--这里是循环的开始-->
                    @{
                        foreach (var project_EX in project_exList.DataList)
                        {
                        <div class="query-result-list">
                            <li class="info pr mb20 fl">
                                <div node-type="qRemind" class="pr">
                                    <a href="/Default/Detail/@project_EX.Id" style="margin-top: 0px;" target="_self" class="link-pic">
                                        <img class="lazyout" src="@project_EX.ProjectThumImage" height="220" width="280" style="display: inline;">
                                    </a>
                                    <div class="q-mask" itemvotype="2" style="height: 0px; overflow: hidden;"></div>
                                </div>
                                 @if (project_EX.AuditStatus == 210)
                                 {
                                     if (project_EX.ProjectStatus == 8)
                                     {
                                        <i class="smll-icons zc-icons">项目预热</i>
                                     }
                                     else
                                     {
                                        <i class="smll-icons zc-icons">众筹中</i>
                                     }
                                 }
                                 else if (project_EX.AuditStatus == 219)
                                 {
                                        <i class="smll-icons zc-icons">众筹结束</i>
                                 }
                                 else if (project_EX.AuditStatus == 220)
                                 {
                                        <i class="smll-icons zc-icons">众筹成功</i>
                                 }
                                <a class="support" id="support_@project_EX.Id" onclick="zanclick(@project_EX.Id,2)" style="display: none;">
                                    <i class="support-icons"></i>
                                    @{
                                 var aaa = _projectService.QueryProjectExpand(project_EX.Id);
                                 if (null != aaa)
                                 {
                                        <span>@aaa.zan</span>   
                                 }
                                 else
                                 {
                                        <span>0</span>   
                                 }
                                    }
                                </a>
                                <script>
                                    var key = getCookie('Praise_System_Id' + "_" + @project_EX.Id);
                                    if (key == "true") {
                                        $("#support_" + @project_EX.Id).addClass("cur");
                                            }
                                </script>
                                <div class="p-outter">
                                    <div class="p-bar">
                                        <span class="p-b-slide" style="width: @project_EX.StrProjectPercent%"></span>
                                    </div>
                                    <div class="p-items">
                                        <ul class="p-i-infos">
                                            <li class="fore1">
                                                <p class="p-percent">@project_EX.StrProjectPercent</p>
                                                <p class="p-extra">已达</p>
                                                <span class="v-line"></span>
                                            </li>
                                            <li class="fore2">
                                                <p class="p-percent">@project_EX.StrCurrentAmount</p>

                                                <p class="p-extra">已筹</p>
                                                <span class="v-line"></span>
                                            </li>
                                            <li class="fore3">
                                                <p class="p-percent">@project_EX.StrRemainDays</p>
                                                <p class="p-extra">剩余时间</p>
                                            </li>
                                        </ul>
                                    </div>
                                </div>


                                <div class="i-tits mb10">
                                    <a href="/Default/Detail/projectId=@project_EX.Id" target="_self">
                                        @if (project_EX.ProjectAdWord.Length > 10)
                                        {
                                            project_EX.ProjectAdWord = project_EX.ProjectAdWord.Substring(0, 10);
                                        }
                                        <h4 class="link-tit mt5">@project_EX.ProjectAdWord</h4>
                                    </a>
                                </div>
                            </li>
                        </div>
                        }
                    }
                    <!--这里是循环的结束-->
                </ul>
            </div>
            <div class="pagesbox" id="gridlist_pagep">
            </div>
        </div>
        <div class="l-fav mt100 pb50">
            @Html.Partial("_CainiXihuang", "list")
        </div>
    </div>
</div>
<script src="~/Scripts/laypage/laypage.js"></script>
<script src="~/Scripts/jquery.cycle.all.js"></script>
<script type="text/javascript"> 
    laypage({
        cont: 'gridlist_pagep',
        pages:  @Model.TotalPage, 
            curr: @Model.PageIndex+1,
            jump: function(e, first){ //触发分页后的回调
                if(!first){ //一定要加此判断，否则初始时会无限刷新 
                    location.href = changeURLArg(location.search, 'page', e.curr); 
                }
            }
        }); 
        $(function() {
            var args  = GetUrlParms(); 
            $("#status_p span").each(function() {
                if(args["AuditStatus"]!=undefined) 
                {  
                    $(this).removeClass("s-checked");
                    if ($(this).attr("code") == args["AuditStatus"]) { 
                        $(this).attr("class", "s-checked");
                    }   
                }  
                $(this).bind("click", function() {
                    location.href = changeURLArg(location.search, 'AuditStatus', $(this).attr("code"));
                }); 
            });
            $("#sort_p a").each(function() {
                if(args["sort"]!=undefined) 
                {  
                    $(this).removeClass("cur");
                    if ($(this).attr("code") == args["sort"]) { 
                        $(this).attr("class", "cur");
                    }   
                } 
                $(this).bind("click", function() {
                    location.href = changeURLArg(location.search, 'sort', $(this).attr("code"));
                }); 
            }); 
            $(".l-menu li").each(function() {
                if(args["ProjectClassId"]!=undefined) 
                {  
                    $(this).removeClass("cur");
                    if ($(this).attr("code") == args["ProjectClassId"]) { 
                        $(this).attr("class", "cur");
                    }   
                }  
            }); 

            
            //产品众筹
            $('#banner2').cycle({
                speed: 400,
                fx: 'scrollLeft',
                pager: '#btn2'
            });


            $("#prev").click(function () {
                $(".tabBox #btn2 a").each(function (i) {
                    var clas = $(this).attr("class");
                    if (clas == "activeSlide") {
                        $(this).prev().addClass("activeSlide").siblings().removeClass("activeSlide");
                        if (i == 0) {
                            $(".tabBox #btn2 a:eq(2)").addClass("activeSlide").siblings().removeClass("activeSlide");
                            $(".tabBox #btn2 a:eq(2)").click();
                        }
                        $(this).prev().click();
                        return false;
                    }
                });
            });

            $('#next').bind("selectstart", function () { return false; });
            //下一张
            $("#next").click(function () {

                $(".tabBox #btn2 a").each(function (i) {
                    var clas = $(this).attr("class");
                    if (clas == "activeSlide") {
                        $(this).next().addClass("activeSlide").siblings().removeClass("activeSlide");
                        if (i == 2) {
                            $(".tabBox #btn2 a:eq(0)").addClass("activeSlide").siblings().removeClass("activeSlide");
                            $(".tabBox #btn2 a:eq(0)").click();
                        }
                        $(this).next().click();
                        return false;
                    }  
                }); 
            });


        });
</script>
